<template>

  <el-table ref="table" :key="tableKey" v-loading="listLoading" :data="list" element-loading-text="正在加载，请稍后" border fit highlight-current-row style="width: 100%;">
    <el-table-column label="所属数据源" min-width="150px">
      <template slot-scope="{row}">
        <span>{{ row.sourceName }}</span>
      </template>
    </el-table-column>
    <el-table-column label="表名" min-width="150px">
      <template slot-scope="{row}">
        <span>{{ row.tableName }}</span>
      </template>
    </el-table-column>
    <el-table-column label="表注释" min-width="150px">
      <template slot-scope="{row}">
        <span>{{ row.tableComment }}</span>
      </template>
    </el-table-column>
    <el-table-column label="描述" min-width="150px">
      <template slot-scope="{row}">
        <span>{{ row.description }}</span>
      </template>
    </el-table-column>
  </el-table>

</template>
  <script>
import { getMasterdataTable } from '@/api/masterdata/masterdataTable'
export default {
  name: 'baseTable',
  props: ['data'],
  data() {
    return {
      tableKey: 0,
      list: [],
      listLoading: false,
    }
  },
  methods: {
    setList(data) {
      this.list = data
    },
    getList(id) {
      getMasterdataTable(id).then((res) => {
        console.log(res, '表详情')
        if (res.data.code == 200) {
          this.list = []
          this.list.push(res.data.data)
        } else {
          this.$message.error(res.data.msg)
        }
      })
    },
  },
}
</script>
  